package fun.tan90.main.listener;

import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;
import org.noear.solon.core.event.AppLoadEndEvent;
import org.noear.solon.core.event.EventListener;
import org.noear.solon.hotplug.PluginManager;

import java.io.File;

@Slf4j
@Component
public class AppLoadEndEventListener implements EventListener<AppLoadEndEvent> {

    String name = "http";

    /**
     * TODO
     * 待修改未 本地路径
     */
    String pluginPath = "C:\\IDE\\study\\solon-demo\\solon-plugin\\solon-http-plugin\\target\\solon-http-plugin.jar";

    @Override
    public void onEvent(AppLoadEndEvent event) throws Throwable {
        PluginManager.add(name, new File(pluginPath));
        PluginManager.start(name);
    }
}